<template>
  <div>
    <div class="header">
      <img :src="item.headerImg" mode="aspectFit">
    </div>
    <scroll-view class="wineCards" scroll-x=true>
      <div class="item" v-for="(item, index) in item.items" :key="index">
        <div class="content">
          <img class="img" :src="item.img" mode="aspectFit">
          <p class="title">{{item.title}}</p>
          <div class="buy">
            <span class="icon">￥</span>
            <span class="price">{{item.price}}</span>
            <span class="oldPrice">原价{{item.oldPrice}}</span>
          </div>
        </div>
      </div>
    </scroll-view>
  </div>
</template>

<script>
export default {
  props: ["item"],
  data() {
    return {};
  }
};
</script>

<style>
::-webkit-scrollbar {
  width: 0;
  height: 0;
  color: transparent;
}
</style>

<style scoped lang="scss">
.header {
  margin-top: 30rpx;
  img {
    width: 700rpx;
    height: 150rpx;
    margin: 0 25rpx;
  }
}
.wineCards {
  white-space: nowrap;
  margin: 20rpx 25rpx 70rpx;
  width: 700rpx;
  box-sizing: border-box;
  .item {
    display: inline-block;
    margin-right: 50rpx;
    .content {
      width: 200rpx;
      height: 410rpx;
      display: flex;
      flex-direction: column;
      white-space: normal;
      font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
      justify-content: space-between;
      .img {
        width: 200rpx;
        height: 290rpx;
      }
      .title {
        font-size: 11px;
        height: 60rpx;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        font-weight: 600;
        color: #343434;
      }
      .buy {
        color: #b93a39;
        .icon {
          font-size: 12px;
        }
        .price {
          display: inline-block;
          margin: 0 5rpx;
        }
        .oldPrice {
          text-decoration: line-through;
          font-size: 10px;
          color: #6d6d6d;
        }
      }
    }
  }
}
</style>

